Hi Lubin and all,
I am still very stuck on this problem.  Please confirm that you can duplicate the problem (#2 above).
the error is:
"
...GenericTypeDefs.h:65:22: error: expected identifier before '(' token 
"
But there is nothing wrong with the code in this file.

Do I have all the source files and header files in the right locations?
Am I missing a file?
Do I have a duplicate definition?

I have tried different arrangements of included source code and include directories.

I have tried this using several versions of Microchip compilers and MPLAB and different versions of Matlab.
Currently I am using 
MATLAB R2011a
MPLAB IDE v8.76
C32 compiler v2.01
and
Embedded Coder for dsPIC V3.7(08-Oct-2011)

I am attaching everything.

Can you please help?
John